package com.kuangstudy.collection.list;

/**
 * ClassName: Application
 * date: 2021/07/12 19:09:10
 *
 * @author zlk
 */
public class Application {
    /**
     * 泛型只能使用引用类类型
     * 不同泛型对象不能相互复制
     * @param args
     */
    public static void main(String[] args) {
        /*使用泛型类创建对象 后面MyGeneric<>中的String可写可不写*/
        MyGeneric<String> myGeneric = new MyGeneric<>();
        myGeneric.t = "hello";
        String t = myGeneric.getT();
        System.out.println(t);
        MyGeneric<Integer> myGeneric1 = new MyGeneric<>();
        myGeneric1.t = 120;
        System.out.println(myGeneric1.getT());
        MyInterfaceImpl my = new MyInterfaceImpl();
        my.getT(123);
        System.out.println("--------------");
        MyInterfaceImpl2<String> my2 = new MyInterfaceImpl2<>();
        System.out.println(my2.getT("kk"));
        MyGenericMethod myGenericMethod = new MyGenericMethod();
        String aaa = myGenericMethod.show("aaa");
        Integer show = myGenericMethod.show(200);
        Double show1 = myGenericMethod.show(3.14);
    }
}
